import KZJRequest from '../index'
import { TRequestDefaultResult } from '../type'

enum Singer {
  Detail = '/mv/detail', // mv详情
  DetailInfo = '/mv/detail/info', // 点赞等数据
  Url = '/mv/url', // mv播放地址
  Comment = '/comment/mv', // mv评论数据
  Simi = '/simi/mv' // 相似mv推荐
}

export function getMvDetail(mvid: number) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Singer.Detail,
    params: { mvid },
    showLoading: true
  })
}

export function getMvDetailInfo(mvid: number) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Singer.DetailInfo,
    params: { mvid },
    showLoading: true
  })
}

export function getMvUrl(id: number) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Singer.Url,
    params: { id },
    showLoading: true
  })
}

export function getMvComment(id: number, offset = 0, limit = 20) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Singer.Comment,
    params: { id, limit, offset },
    showLoading: true
  })
}

export function getMvSimi(mvid: number) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Singer.Simi,
    params: { mvid },
    showLoading: true
  })
}
